from flask import Flask, jsonify, render_template
from handle.analyse import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/bar1')
def bar1():
    return jsonify(wind_speed_top10())


@app.route('/bar2')
def bar2():
    return jsonify(time_top10())


@app.route('/line')
def line():
    return jsonify(month_count())


@app.route('/pie')
def pie():
    return jsonify(typhoon_level_pie())


@app.route('/boxplot')
def boxplot():
    return jsonify(hPa_boxplot())


if __name__ == '__main__':
    app.run()
